package com.base.controller;

import com.base.po.voip_coupon.CouponBrand;
import com.base.po.voip_coupon.CouponCategory;
import com.base.service.COUPON.CouponBrandService;
import com.base.service.COUPON.CouponCategoryService;
import com.base.service.LogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * 修改365优惠券品牌信息服务端
 * 
 * @author K
 *
 */
@Controller
@RequestMapping("/admin")
public class update_CouponBrand {

	@Autowired
	private LogsService logsService; // log日志
	@Autowired
	private CouponBrandService couponBrandService; // 商品品牌信息

	// 修改商圈信息
	@RequestMapping(value = "/toUpdateCouponBrand", method = RequestMethod.POST)
	public @ResponseBody int toUpdateCouponBrand(HttpServletRequest request, @RequestBody CouponBrand couponBrand) throws Exception {
		if (request.getSession().getAttribute("adminUserId") == null) return -1; // 未登录
		return couponBrandService.updateByPrimaryKeySelective(couponBrand); // 修改
	}
}
